package com.hc.mapper;

import com.hc.domain.Category;
import com.hc.domain.Technology;
import com.hc.domain.User;
import com.hc.query.CategoryVO;
import com.hc.query.TechnologyVO;
import com.hc.query.UserVO;
import com.hc.service.CategoryService;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: hecai
 * @date: 2021/11/9 11:17
 * @description:
 */
@Mapper
public interface CategoryMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Category record);

    int insertSelective(Category record);

    Category selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Category record);

    int updateByPrimaryKey(Category record);
    Category selectByName(String name);

    String selectNameByPrimaryKey(Long id);
    /**
     * 获取所有类别
     * @return
     */
    List<Category> getCategoryByCondition();

    /**
     * 查寻指定父类别编号下面的子类别
     * @param pid
     * @return
     */
    List<Category> selectCategoryByPid(@Param("pid") Integer pid);

    List<Category> selectCategoryByFidAndCid(@Param("fid") Integer fid,@Param("cid") Integer cid);

    List<Long> selectIdsByName(@Param("names") String[] names);

    List<Category> selectIdsByPid(@Param("pid") Long pid);

    /**
     * 查询多个技术 ，搜索框模糊查找
     * @return
     */
    List<Category> selectCategorysByCondition(CategoryVO categoryVO);

    /**
     * 根据用户id启用技术
     * @param id
     * @return
     */
    int avctiveByPrimaryKey(Long id);

    /**
     * 根据用户id启用技术
     * @param id
     * @return
     */
    int disabledByPrimaryKey(Long id);
}